<template>
  <Menu
    ref="menu"
    :theme="theme"
    :active-name="activeName"
    :open-names="openedNames"
    accordion
    width="auto"
    @on-select="name=>$emit('on-select', name)"
  >
    <template v-for="(child,index) in menuList">
      <default-menu-sub v-if="showChildren(child)" :item="child" :key="index" />
      <default-menu-item v-else :item="child" :key="index" />
    </template>
  </Menu>
</template>

<script>
import mixin from "./mixin";
import DefaultMenuSub from "./default-menu-sub";
import DefaultMenuItem from "./default-menu-item";
export default {
  components: { DefaultMenuSub, DefaultMenuItem },
  mixins: [mixin]
};
</script>
